home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgramD2.iso
/
Languages
/
Ms Fortran 7.7
/
README.DOC
< prev
Wrap
Text File
|
1995-07-29
|
10KB
|
271 lines
RELEASED BY:-
WAJID SHARIF
SOFTWARE BANK
84-GROUND FLOOR, HAFEEZ CENTRE, GULBERG III,
LAHORE. PH. 5752808 - 5761408.
*--------------------------------------------*
FORTRAN 77 VER 3.10
1.0 INTRODUCTION
This describes changes to MS-Fortran that were made too
late to be described in either the reference manual or the
User's Guide and its addendum.
2.0 FILES ON DISTRIBUTION DISKS
Fortran compiler.
a. FOR1.EEM - FORTRAN compiler using 8087 emulation code.
FOR1.EXE - Identical to FOR1.EEM.
b. FOR1.E87 - FORTRAN compiler using 8087 code.
Unless special arrangements have been made with Microsoft, the
emulation compiler utilizes 8086-88 interrupt vectors 52-63 for
real number emulation and the 8087 compiler vectors 8087 interrupts
through vector 3 ( NMI ).
Code generation.
c. PAS2.EXE - 8086-87 code generator.
d. PAS3.EXE - 8086-87 object file disassembler.
Runtime support.
e. FORTRAN.LEM - FORTRAN 8087 emulation library.
f. FORTRAN.L87 - FORTRAN 8087 library.
Support documents.
g. README.DOC - Current release information.
h. FORTRAN.P87 - Link map of the 8087 FORTRAN library.
i. FORTRAN.PEM - Link map of the emulation FORTRAN library.
Support software.
j. LINK.V1 - Microsoft object linker for MS-DOS 1.25
k. LINK.V2 - Microsoft object linker for MS-DOS 2.00
Support objects.
l. NULF.OBJ - The dummy file system.
m. NULE6.OBJ - The dummy error system.
n. NULR7.OBJ - The dummy real number system.
Support source.
o. ENTX6L.ASM - Execution control module assembler source.
p. DEMO.FOR - Demonstration program.
Page 2
3.0 ALTERNATIVE LINKER
Two versions of the MS-LINK utility are provided with
this version of MS Fortran. The first, named LINK.V1 is the
most current linker for MS-DOS versions 1.25 and below. It
will run under MS-DOS 2.0 but cannot accept pathnames or
subdirectories. The other is named LINK.V2 and will run
only on MS-DOS 2.0. The limits on program size,
relocations, externals per module etc., are bigger for
LINK.V2 than for either LINK.V1 or the linker usually
supplied with MS-DOS 2.0. The interface to both linkers is
identical and is as described in the linker documentation.
You should rename the one you want to use LINK.EXE.
4.0 $MESSAGE METACOMMAND
The $MESSAGE metacommand can be used to send messages
to the standard output device when running the Fortran front
end, for example:
$MESSAGE 'This will appear on the screen when you run FOR1'
5.0 EXTENDED NON-DECIMAL NUMBERS
Although the maximum 32-bit integer value is defined as
2**31-1, the compiler and runtime will read values which are
nominally in the range upto 2**32 without giving an error if
the radix is other than 10. They will be interpreted as the
negative numbers with the corresponding internal
representation. For example, 16#FFFFFFFF will result in all
the bits in the 32-bit integer result being set, and will
have an arithmetic value of -1.
6.0 FLOATING POINT OPERATIONS
Most users of MS-Fortran will find the default
behaviour of the floating point operations will provide
extremely accurate, consistent and efficient processing of
their algorithms, whether they have an 8087 installed or
not. If this is the case for you, you need not be concerned
with the issues described either below or in the addendum to
the User's Guide.
However, those who wish to take advantage of the full
power and flexiblity of the proposed IEEE Real Math Standard
should read both the addendum and the following description
carefully.
Page 3
6.1 Math Package Size
The REAL arithmetic support routines contribute about
8k bytes to your program and not 4.5k as specified in the
addendum. Note that if your program does not use floating
point you can use NULR7.OBJ to regain this space (see
section 6.5.3 of the User's Guide).
6.2 $FLOATCALLS And The 8087
Contrary to the description in the addendum to the
Fortran User's Guide, programs compiled with the $FLOATCALLS
option, linked with the emulator library and run on a
machine with an 8087, will use the 8087 to do the actual
arithmetic. This means that using this option will result
in a much smaller performance penalty, when you have an
8087, than suggested in the addendum.
6.3 Environment Control And Exception Handling For 8087 Math
The five exceptions required by the IEEE standard are
supported by both the 8087 and the Real Math support
routines. By default, they are disabled. Contrary to the
description in the MS-Fortran reference (Section 6.2.1) the
$DEBUG metacommand does not control the handling of these
exceptions (you should continue to use it to control Integer
aritmetic errors, however). Instead, there are two memory
locations that control both processors. These are called
the CONTROL and STATUS words. The effect of these words is
discussed below. You can read or set their values using the
following subroutines:
SUBROUTINE SCRWQQ (CW)
INTEGER*2 CW
C Sets the control word to the value in CW
SUBROUTINE LCWRQQ (CW)
INTEGER*2 CW
C CW is set to the value of the control word
SUBROUTINE SSWRQQ (SW)
INTEGER*2 SW
C Sets the status word to the value in SW
SUBROUTINE LSWRQQ (SW)
INTEGER*2 SW
C SW is set to the value of the status word
Page 4
The five IEEE Standard exceptions are:
1. Invalid Operation - Any operation with a NAN (not a
number),square root(-1), 0*INF, etc. Generally
returns a NAN.
2. Divide by zero - Returns properly signed INF.
3. Overflow - Number greater than maximum representable
number. Returns INF.
4. Underflow - Number smaller than smallest valid
representable number. Returns a Denormal or a zero.
5. Precision - Occurs whenever a result is subjected to
rounding error. Informs that the result is not
exact. Return properly rounded result.
When one of these exceptional conditions occurs the
appropriate bit in the status word is set. This flag will
remain set to indicate that the exception occured until
cleared by the user. If the bit in the control word
relating to a given exception is set then that exception is
masked and the operation proceeds with a supplied default.
If the bit is unset any exception of that type generates an
error message, halts the operation and your program will
stop. In either case the exception is ORed into the STATUS
word.
The CONTROL word is also used to set modes for the
internal arithmetic required by the IEEE standard. These
are:
Rounding Control - round to nearest (or even), Up,
Down, or Chop
Precision Control - Determines at which bit of the
manstissa rounding should take place. (24, 53,
or 64). Note all results are done to 64 bits
regardless of the precision control. It only
affects the rounding in the internal form.
On storage any result is again rounded to the
storage precision.
Infinity Control - Affine mode is the familar + and
- INF style of arithmetic. Projective mode is a
mode where + and - INF are considered to be the
same number. The principal effect is to change the
nature of comparisons (Projective INF does not
compare with anything but itself).
Page 5
Format for STATUS BYTE and CONTROL WORD
15 8 7 6 5 4 3 2 1 0
STATUS | hi byte unused | | |PE|UE|OE|ZE| |IE|
| | | | |
Precision Exception -------------------+ | | | |
Underflow Exception ----------------------+ | | |
Overflow Exception --------------------------+ | |
Zero Divide Exception --------------------------+ |
Invalid Exception ------------------------------------+
(All other bits unused, may be either 1 or 0)
15 14 15 12 11-10 9-8 7 6 5 4 3 2 1 0
CONTROL | | | |IC| RC | PC | | |PM|UM|OM|ZM| |IM|
| | | | | | | |
Infinity Control -+ | | | | | | |
Round Control --------+ | | | | | |
Precision Control ----------+ | | | | |
| | | | |
Precision Mask ------------------------+ | | | |
Underflow Mask ---------------------------+ | | |
Overflow Mask -------------------------------+ | |
Zero Divide Mask -------------------------------+ |
Invalid Mask -----------------------------------------+
(All other bits unused, may be either 1 or 0)
Infinity Control
0 = Projective
1 = Affine
Round Control
00 = Round nearest or even
01 = Round down (toward -INF)
10 = Round up (toward +INF)
11 = Chop (Truncate toward 0)
Precision Control
00 = 24 bits of mantissa
01 = (reserved)
10 = 53 bits of mantissa
11 = 64 bits of mantissa